/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.persistencia.domain;

import java.io.Serializable;
import javax.persistence.*;

/**
 *
 * @author kenny
 */
@Entity
@Table(name = "clasexsalon")
@NamedQueries({
    @NamedQuery(name = "Clasexsalon.findAll", query = "SELECT c FROM Clasexsalon c"),
    @NamedQuery(name = "Clasexsalon.findByNDcnCls1Id", query = "SELECT c FROM Clasexsalon c WHERE c.clasexsalonPK.nDcnCls1Id = :nDcnCls1Id"),
    @NamedQuery(name = "Clasexsalon.findByNSlnId", query = "SELECT c FROM Clasexsalon c WHERE c.clasexsalonPK.nSlnId = :nSlnId"),
    @NamedQuery(name = "Clasexsalon.findByVEstado", query = "SELECT c FROM Clasexsalon c WHERE c.vEstado = :vEstado")})
public class Clasexsalon implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected ClasexsalonPK clasexsalonPK;
    @Column(name = "vEstado")
    private String vEstado;
    @JoinColumn(name = "nSlnId", referencedColumnName = "nSlnId", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Salon salon;
    @JoinColumn(name = "nDcnCls1Id", referencedColumnName = "nDcnClsId", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Docentexclase docentexclase;

    public Clasexsalon() {
    }

    public Clasexsalon(ClasexsalonPK clasexsalonPK) {
        this.clasexsalonPK = clasexsalonPK;
    }

    public Clasexsalon(int nDcnCls1Id, int nSlnId) {
        this.clasexsalonPK = new ClasexsalonPK(nDcnCls1Id, nSlnId);
    }

    public ClasexsalonPK getClasexsalonPK() {
        return clasexsalonPK;
    }

    public void setClasexsalonPK(ClasexsalonPK clasexsalonPK) {
        this.clasexsalonPK = clasexsalonPK;
    }

    public String getVEstado() {
        return vEstado;
    }

    public void setVEstado(String vEstado) {
        this.vEstado = vEstado;
    }

    public Salon getSalon() {
        return salon;
    }

    public void setSalon(Salon salon) {
        this.salon = salon;
    }

    public Docentexclase getDocentexclase() {
        return docentexclase;
    }

    public void setDocentexclase(Docentexclase docentexclase) {
        this.docentexclase = docentexclase;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (clasexsalonPK != null ? clasexsalonPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Clasexsalon)) {
            return false;
        }
        Clasexsalon other = (Clasexsalon) object;
        if ((this.clasexsalonPK == null && other.clasexsalonPK != null) || (this.clasexsalonPK != null && !this.clasexsalonPK.equals(other.clasexsalonPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.persistencia.domain.Clasexsalon[ clasexsalonPK=" + clasexsalonPK + " ]";
    }
    
}
